﻿import gs.TweenLite;
import mx.utils.Delegate;
import A2.btnEffect.uBtn; 
class A2.btnEffect.BEV3 {
	// Btn of Effect
	
	function BEV3(scope:MovieClip, btn:MovieClip, mnact:Function, obj:Object) {
		if (btn.real != null) 	btn.hitArea = btn.real;btn.real._alpha = 0;		
		if (obj.over != null) 	btn._onRollOver = Delegate.create(scope, obj.over);
		if (obj.out != null) 	btn._onRollOut = Delegate.create(scope, obj.out);
		if (mnact != null) 		btn._onRelease = Delegate.create(scope, mnact);
		btn.onRollOver = function(evt) {
			this._onRollOver({id:uBtn.getLastID(this._name),it:this});
			this.gotoAndPlay('s1');
		};
		btn.onRollOut = btn.onReleaseOutside = function () {
			if (this.gp._id != null) {
				this._onRollOut( { id:uBtn.getLastID(this._name), it:this, gid:this.gid,oid:this.gp._id } );
				}else{
				this._onRollOut( { id:uBtn.getLastID(this._name), it:this } );
			}
			this.gotoAndPlay('s2');
		};
		btn.onRelease = function (evt) { 
			if (evt != null) {
				this._onRelease(evt);
			}else{
				this._onRelease( { id:uBtn.getLastID(this._name), it:this } );  
			}
		}; 
		if (obj != undefined) for (var i in obj) {btn[i] = obj[i];} 
	}
}
